package com.laicunba.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.laicunba.pojo.ChannelDO;
import com.laicunba.service.ChannelService;

@Service
public class ChannelServiceImpl extends BaseServiceImpl implements ChannelService {

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public ChannelDO find(String ip, String os, String sn) {
		Map map = new HashMap();
		map.put("ip", ip);
		map.put("os", os);
		map.put("sn", sn);
		return this.queryDao.selectOne("CHANNEL.find", map);
	}

	@Override
	public ChannelDO find(String push_id) {
		return queryDao.selectOne("CHANNEL.findByPushId", push_id);
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public void updateStatus(String id, String status) {
		Map map = new HashMap();
		map.put("id", id);
		map.put("status", status);
		updateDao.update("CHANNEL.updateStatus", map);
	}

}
